# from http import HTTPStatus
# import dashscope


# def call_with_prompt():
#     response = dashscope.Generation.call(
#         model=dashscope.Generation.Models.qwen_turbo,
#         prompt='请介绍一下通义千问'
#     )
#     # 如果调用成功，则打印模型的输出
#     if response.status_code == HTTPStatus.OK:
#         print(response)
#     # 如果调用失败，则打印出错误码与失败信息
#     else:
#         print(response.code)  
#         print(response.message) 

# if __name__ == '__main__':
#     call_with_prompt()

from sklearn.linear_model import LinearRegression

x = [[80, 86],
[82, 80],
[85, 78],
[90, 90],
[86, 82],
[82, 90],
[78, 80],
[92, 94]]
y = [84.2, 80.6, 80.1, 90, 83.2, 87.6, 79.4, 93.4]

# 实例化API
estimator = LinearRegression()
# 使用fit方法进行训练
estimator.fit(x,y)

print("打印对应的系数:", estimator.coef_)

print("打印预测结果：", estimator.predict([[100, 80]]))